//
//  PersonInformationViewController.m
//  FlowerRainGround
//
//  Created by lanou on 16/4/20.
//  Copyright © 2016年 lanou. All rights reserved.
//

#import "PersonInformationViewController.h"
#import "UserInformationView.h"
@interface PersonInformationViewController ()
@property (strong, nonatomic) IBOutlet UIScrollView *scrollerView;

@end

@implementation PersonInformationViewController


- (void)setNavBar{
    self.navigationItem.title = @"个人资料";
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake(0, 0, 50, 25);
    [button setTitle:@"保存" forState:UIControlStateNormal];
    UIBarButtonItem *right = [[UIBarButtonItem alloc] initWithCustomView:button];
    button.block = ^(){
        [self save];
    };
    self.navigationItem.rightBarButtonItem = right;
}

//点击保存的方法
- (void)save
{
    NSLog(@"保存成功");
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setNavBar];
    
    //创建滚动视图
    self.scrollerView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
    self.scrollerView.contentSize = CGSizeMake(kWidth, 1.2*kHeight);
    self.scrollerView.showsVerticalScrollIndicator = YES;
    
    //自定义视图
    UserInformationView *view = [[UserInformationView alloc] initWithFrame:self.view.bounds];
    [self.scrollerView addSubview:view];
    [self.view addSubview:self.scrollerView];
    
    
    
    
    
    
    
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
